import request from '@/utils/request'

// 主贴列表
export function getThreadApi(data) {
  return request({
    url: '/thread/pageInfo',
    method: 'post',
    data
  })
}

// 保存主贴信息
export function threadSaveApi(data) {
  return request({
    url: '/thread/save',
    method: 'post',
    data
  })
}

// 启用禁用主贴
export function threadChangeStateApi(data) {
  return request({
    url: '/thread/changeState',
    method: 'post',
    data
  })
}

// 删除主贴
export function deleteThreadApi(data) {
  return request({
    url: '/thread/batchDelete',
    method: 'post',
    data
  })
}

// 话题列表
export function getThreadTagApi(data) {
  return request({
    url: '/threadTag/pageInfo',
    method: 'post',
    data
  })
}

// 保存话题
export function threadTagSaveApi(data) {
  return request({
    url: '/threadTag/save',
    method: 'post',
    data
  })
}

// 修改话题状态
export function threadTagChangeStateApi(data) {
  return request({
    url: '/threadTag/changeState',
    method: 'post',
    data
  })
}

// 删除话题
export function threadTagBatchDeleteApi(data) {
  return request({
    url: '/threadTag/batchDelete',
    method: 'post',
    data
  })
}

// 获取话题详情
export function getThreadTagDetailApi(id) {
  return request({
    url: `/threadTag/detail/${id}`,
    method: 'post',
  })
}

// 举报列表
export function getReportListApi(data) {
  return request({
    url: '/userReport/pageInfo',
    method: 'post',
    data
  })
}
// 处理举报
export function reportSaveApi(data) {
  return request({
    url: '/userReport/save',
    method: 'post',
    data
  })
}
// 删除举报
export function deleteReportApi(data) {
  return request({
    url: '/userReport/batchDelete',
    method: 'post',
    data
  })
}

// 评论列表
export function getCommentListApi(data) {
  return request({
    url: '/threadComment/pageInfo',
    method: 'post',
    data
  })
}

// 删除评论
export function deleteCommentApi(data) {
  return request({
    url: '/threadComment/batchDelete',
    method: 'post',
    data
  })
}

export function getOneTypeListApi(data) {
  return request({
    url: '/thread/getTagTypes',
    method: 'post',
    data
  })
}